﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Cinema_Ticketing_System.Models
{
    public class Get_Play
    {
        CinemaDBEntities2 cdb = new CinemaDBEntities2();
        public List<play_table> GetPlay(int cid,int fid)
        {
            List<play_table> playList;
            if (cid != -99)
            {
                playList = cdb.play_table.ToList();
                playList = playList.Where(x => x.cinemaid == cid).ToList();
                return playList;

            }
            if (fid != -88)
            {
                playList = cdb.play_table.ToList();
                playList = playList.Where(x => x.filmid == fid).ToList();
                return playList;
            }

            return null;
        }
    }
}